<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>for循环的学习</title>
		<style>
			.jz{
				width: 120px;
				height:30px;
				text-align:center;
				margin-left: 50%;
				margin-top: 20%;
				position: relative;
			}
			.jz2{
				width: 120px;
				height:30px;
				background: gold;
				color: red;
				text-align: center;
				font-weight: bold;
				position: absolute;
				top:46%;
				left: 50%;
				transition: all 0.2s linear;
			}
			.jz2:hover{
				color: green;
				background:tan;
				cursor: pointer;
			}
		</style>
	</head>
	<body>
		<input type="text" id="nb" placeholder="666666" class="jz"/>
		<button onclick="a()" class="jz2">自动生成WG</button>
		<script>
			//for循环
			//for(var a=0;a<100;a++){
			//	document.write(a+"<br/>");
				//程序的执行顺序是怎么样的？
				//1、var a=0
				//2、a<100
				//3、document.write(a+"<br/>")
				//4、a++
				//5、a<100
				//6、document.write(a+"<br/>")
				//7、a++
				//8、a<100
				//9、......
		//	}
		//	for(var b=1;b<=40;b++){
			//	document.write(b+"<br/>");
		//	}
		//	for(var b=40;b>=1;b--){
			//	document.write(b+"<br/>");
			//}
			//for(var n=0;n<=100;n+=2){
				//	document.write(n+",");
			//}
		//	for(var s=5;s<=100;s++){
				//if(s%5==0){
			//		document.write(s+",");
		//	}
	//	}
			//不是3的倍数且不包含3
			function a(){
				var s=document.getElementById("nb").value;
				for(var u=0;u<=100;u++){
					if(u%s !=0 && u%10 !=s && parseInt((u%100)/10)!=s){
						document.write(u+",");
						alert("跟着我左手右手一个慢动作");
				}
					else{
						document.write("*"+",")
						alert("什么玩意儿！又错了！");
				}
			}
			}

			//for(var u=0;u<=100;u++){
			//	if(parseInt((u%100)/10)==3){
			//		document.write(u+"<br />");
			//	}
		//	}
		//	for(var i=0;i<100;i++){
			//	if(Math.floor(i/10)==3){
				//	document.write(i+"<br />")
			//	}
			//}
		</script>
	</body>
</html>
